/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.model;

import com.entities.EventLibrary;
import com.entities.EventTypeCharts;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Tuan Long
 */
public class ChartData {

    public static List<EventTypeCharts> getEventTotalTypeData() {
        EventLibraryModel model = new EventLibraryModel();
        List<EventLibrary> data = model.fillTotalEventTypeTable();
        List<EventTypeCharts> list = new ArrayList<EventTypeCharts>();
        int index =1;
        for (EventLibrary el : data) {            
            EventTypeCharts chart = new EventTypeCharts();
            String tag = el.getEventType();
            String amount = el.getTotal();
            chart.setId(index);
            chart.setTag(tag);            
            chart.setAmount(amount);
            list.add(chart);
            index++;
        }
        return list;
    }
    
}
